﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace EFEntity.Migrations
{
    public partial class dbmini1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "config_public_char",
                columns: table => new
                {
                    pbc_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    attribute_kind = table.Column<string>(maxLength: 60, nullable: false),
                    attribute_name = table.Column<string>(maxLength: 60, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_config_public_char", x => x.pbc_id);
                });

            migrationBuilder.CreateTable(
                name: "salary_standard",
                columns: table => new
                {
                    ssd_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    standard_id = table.Column<string>(maxLength: 30, nullable: false),
                    standard_name = table.Column<string>(maxLength: 60, nullable: false),
                    designer = table.Column<string>(maxLength: 60, nullable: false),
                    register = table.Column<string>(maxLength: 60, nullable: false),
                    checker = table.Column<string>(maxLength: 60, nullable: true),
                    changer = table.Column<string>(maxLength: 60, nullable: true),
                    regist_time = table.Column<DateTime>(nullable: false),
                    check_time = table.Column<DateTime>(nullable: false),
                    change_time = table.Column<DateTime>(nullable: false),
                    salary_sum = table.Column<double>(nullable: false),
                    check_status = table.Column<int>(maxLength: 20, nullable: false),
                    change_status = table.Column<int>(maxLength: 20, nullable: false),
                    check_comment = table.Column<string>(maxLength: 60, nullable: true),
                    remark = table.Column<string>(maxLength: 60, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_salary_standard", x => x.ssd_id);
                });

            migrationBuilder.CreateTable(
                name: "salary_standard_details",
                columns: table => new
                {
                    sdt_id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    standard_id = table.Column<string>(maxLength: 30, nullable: true),
                    standard_name = table.Column<string>(maxLength: 60, nullable: true),
                    item_id = table.Column<int>(maxLength: 20, nullable: false),
                    item_name = table.Column<string>(maxLength: 60, nullable: true),
                    salary = table.Column<double>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_salary_standard_details", x => x.sdt_id);
                });

            
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "config_public_char");

            migrationBuilder.DropTable(
                name: "salary_standard");

            migrationBuilder.DropTable(
                name: "salary_standard_details");

        }
    }
}
